<script type="text/javascript">

function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    /*carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });
	*/
    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};

jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
        auto: 2,
        wrap: 'last',
        initCallback: mycarousel_initCallback
    });
});

</script> 
<div class="hot-product">
	<div class="top">
		<div class="right">
			<div class="body" style="line-height:27px; padding-left:10px; font-weight:bold;"><img src="<?=$root?>/themes/images/icon/star.gif" /> Sản phẩm nổi bật</div>
		</div>
	</div>
	
	<div class="main">
	<div class="jcarousel-clip jcarousel-clip-horizontal" style="position: relative; ">
		<ul id="mycarousel" class="jcarousel-skin-tango">
		    
			<?
				$rs = $db->query("SELECT * FROM ".$prefix."sanpham WHERE t_noibat = 1 AND t_hienthi = 1 ORDER BY RAND() LIMIT 18");
				while($row = $db->fetch_array($rs)){
				$t_tieude = stripslashes($row[t_tieude]);
				$t_id = $row[t_id];
				$t_hinhanh = $PathThumbFile . $row[t_hinhanh];
				$t_loaitien = loadLoaiTien($row[t_loaitien]);
				if($t_loaitien == "VNĐ"){
					$t_loaitien = "đ";
				}
				$t_giaban = showprice($row[t_giaban]);
			?>
		            <li>
			            <div class="picture">				        
				            <a title="<?=$t_tieude?>" href="<?=$root?>/chi-tiet-san-pham/<?=$t_id?>/<?=$myString->vietdecode($t_tieude)?>"> <img width="140" height="140px" src="<?=$root?>/<?=$t_hinhanh?>" alt="<?=$t_tieude?>" onerror="this.src='<?=$root?>/themes/images/noimg.jpg';"/></a>							
			            </div>
			            <div class="tieude">
							<a title="<?=$t_tieude?>" href="<?=$root?>/chi-tiet-san-pham/<?=$t_id?>/<?=$myString->vietdecode($t_tieude)?>"><?=$t_tieude?></a>
						</div>
                        <div class="price"><?=$t_giaban?><?=$t_loaitien?></div>	                        
		            </li>	
			<? } ?>
		</ul>
	</div>
	</div>	
</div>
<br/>